#include <stdio.h>
int get_fibonacci(int loop);
double get_result(double n);

int main()
{
	int scanfed = 0;
	printf("input the num you want to :\n");
	//testing
	scanf("%d", &scanfed);
	printf("%d", get_fibonacci(scanfed));

	printf("\n%lf",get_result(scanfed));

	return 0;
}

// return a fibonacci value which input NO.
//  1->1  2->1  3->2  4->3  5->5  6->8  ....
int get_fibonacci(int loop)
{
	int first = 1;
	int second = 1;
	int third = 1;

	for (int i = 3; i <= loop; i++) //
	{
		if (loop == 0) //定义初始值
			return 0;
		if (loop == 1 || loop == 2)
			return 1;

		third = first + second;
		first = second;
		second = third;
	}
	return third;
}

double get_result(double n)
{
//	return get_fibonacci(n+2)/get_fibonacci(n+1);		这样写就不行!!
	return (double)get_fibonacci
	(n+2)/get_fibonacci(n+1);
}